FROM python:3.11

# 设置工作目录为根目录
WORKDIR /

RUN apt-get update -y && \
    apt-get install -y python3-pip python3-dev

COPY ./requirements.txt /requirements.txt

RUN pip3 install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
# 设置时区
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

COPY . /
## 使用gunicorn
# CMD ["gunicorn", "app:app", "-c", "./gunicorn/config.py"]
# 监听5000端口
EXPOSE 5000
## 若不使用gunicorn, 直接python运行app.py
ENTRYPOINT [ "python3" ]
CMD [ "app.py" ]

